﻿<%
Class qingtian_class   
               
	'================================================
	'函数名：UTF8
	'作  用：GB2312转UTF-8
	'参  数：Str   ----要转换的字符
	'================================================
     Public Function MsgConfig(FromID,CuTxt)
Set rsx6543=Conn.execute("insert into Guest (TakeId,SendId,TakeNa,SendNa,Content,Times,Isview,Isad,tDel,sDel,Tops) values ("&FromID&",0,'"&UserStr(FromID,"UsName")&"','系统消息','"&CuTxt&"','"&Now()&"',0,0,0,0,0)")
End Function

    Public Function Login(SID,Str)
    set Rs=server.CreateObject("adodb.recordset")
    Rs.open "select * from [users] where ID='"&SID&"'",conn,1,1
    if Rs.eof or Rs.bof then
    Login=False
    Else
    Login=Rs(Str)
    End if
    Rs.close
    set Rs=nothing                '关闭对象
    End Function

    Public Function bi()
			bi="G币"
    End Function

    Public Function money()
    money=Login(qingtian.nid,"Cent")
    End Function

    Public Function nid()
    dim knid
    knid=len(cc)-12
    nid=clng(left(cc,knid))
    End Function

    Public Function togin()
    dim kpass,kpass1
    kpass=right(cc,6)
    kpass1=mid(login(nid,"UsPass"),15,6)
    if kpass=kpass1 then
    togin=true
    else
    togin=false
    end if
    End Function

    Public Function name(ByVal nid)
    dim namet
    namet=Login(nid,"UsName")
    if namet=false then
    name="出错"
    else
    name=namet
    end if
    End Function

    Public Function onl(ByVal nid)
	if datediff("s",login(qingtian.nid,"EndTime"),now())<666 then
	onl="在线"
	else
	onl="离线"
	end if
	Rs.close
	set rs=nothing
    End Function



	'================================================
	'函数名：RunStr
	'作  用：随机字符
	'================================================
    	Public Function RunStr()
		dim str,i
		str=year(Now()) & month(now()) & day(now()) & hour(now()) & minute(now()) & second(now())
		for i=1 to 5
		randomize
		str=str&int((9)*rnd+1)
		Next
		RunStr=str
    	End Function


    Public Function pay(str,str1)
        dim strr,strr1,rs,sql
        strr=str
        strr1=str1
	Set Rs = Server.CreateObject("Adodb.Recordset")
	Sql = "select top 1 Cent from [users] where Id="&strr1&""
	Rs.Open Sql,conn,1,3
if rs("Cent")+strr < 0 then
err("TA的账户余额不足")
else
	rs("Cent")=rs("Cent")+strr
end if
	rs.update
	Rs.close
	set rs=nothing
    End Function
   	Public Function UTF8(ByVal Str)

        If Str = "" Or IsNull(Str) Then
            utf8 = Str

            Exit Function
        End If

        str = Replace(str, "&", "&amp;")
        str = Replace(str, "<", "&lt;")
        str = Replace(str, ">", "&gt;")
        str = Replace(str, "[br]", "<br/>")
        str = Replace(str, Chr(34), "&quot;")             '双引号
        str = Replace(str, Chr(39), "&#39;")
	str = replace(str,"","")              '单引号
	str = replace(str,"","")
	str = replace(str,"^","")
	str = replace(str,"","")
	str = replace(str," ","")
	str = replace(str,"Λ","")
	str = replace(str,"Ψ","")
	str = replace(str,"","")
        str = Replace(str, "$", "$$")
        str = Replace(str, Chr(32)&Chr(10), "<br/>")
        str = Replace(str, vbNewLine, "<br/>")
        str = Replace(str, "&amp;nbsp;", "&nbsp;")
        str = Replace(str, "&amp;lt;", "&lt;")
        str = Replace(str, "&amp;gt;", "&gt;")
        str = Replace(str, "&amp;quot;", "&quot;")             '双引号
        str = Replace(str, "&amp;#39;", "&#39;")              '单引号

	utf8=str
    	End Function
    Public Function pay1(str,str1)
        dim strr,strr1,rs,sql
        strr=str
        strr1=str1
	Set Rs = Server.CreateObject("Adodb.Recordset")
	Sql = "select top 1 Cent from [users] where Id="&strr1&""
	Rs.Open Sql,conn,1,3
if rs("Cent")+strr < 0 then
err("TA的账户余额不足")
else
	rs("Cent")=rs("Cent")+strr
end if
	rs.update
	Rs.close
	set rs=nothing
    End Function
    Public Function payy(str)
        dim strr,rs,sql
        strr=str
	Set Rs = Server.CreateObject("Adodb.Recordset")
	Sql = "select top 1 Cent from [users] where id="&qingtian.nid&""
	Rs.Open Sql,conn,1,3
if rs("Cent")+strr < 0 then
err("你的账户余额不足")
else
	rs("Cent")=rs("Cent")+strr
end if
	rs.update
	Rs.close
	set rs=nothing
    End Function
    Public Function err(str)
        dim strr
        strr=str
Response.Write("出错了!"&strr&"<br/>")
Response.Write("<anchor>返回来源页<prev /></anchor><br/>")
Response.Write qingtian.qingsav("700")
Response.Write("</p></card></wml>") 
set conn=nothing
set cn=nothing
Response.end
    End Function
    Public Function shuchu()
%>
</p>
</card>
</wml> 
<%
response.write("<!--晴天3G建站系统-wap.qt3g.com-->")
conn=close
liao=close
set conn=nothing
set liao=nothing
Response.Flush
    End Function

end class
%>